from appium.webdriver.common.mobileby import MobileBy

from HomeWork_PO_Apptest_add_and_delete_members.base.base_page import BasePage

from HomeWork_PO_Apptest_add_and_delete_members.page.editmember_page import EditMemberPage


class AddMemberPage(BasePage):
    def addmember_manual(self):
        #点击“手动输入添加”跳转到编辑成员页
        self.driver.find_element(MobileBy.XPATH, '//*[@text="手动输入添加"]').click()
        return EditMemberPage(self.driver)
    def get_result(self):
        result = self.driver.find_element(MobileBy.XPATH,
                                       '//*[@class="android.widget.Toast"]//*[contains(@text,"添加成功")]').text
        return result
    def return_to_addresslist(self):
        from HomeWork_PO_Apptest_add_and_delete_members.page.addresslist_page import AddressListPage
        return AddressListPage(self.driver)